import request from "@/utils/request";
/*****************  用户管理  *******************/
// 列表
export function userList(params) {
  return request({
    url: "/user",
    headers: {
      isToken: false,
    },
    method: "get",
    params,
  });
}
// 新增
export function userAdd(params) {
  return request({
    url: "/user/add",
    headers: {
      isToken: false,
    },
    method: "post",
    data: params,
  });
}
// 修改
export function userEdit(id: number, params) {
  return request({
    url: `/user/${id}`,
    headers: {
      isToken: false,
    },
    method: "patch",
    data: params,
  });
}
// 删除
export function userDel(params) {
  return request({
    url: `/user/delete`,
    headers: {
      isToken: false,
    },
    method: "post",
    data: params
  });
}
// 详情
export function userInfo(id) {
  return request({
    url: `/user/${id}`,
    headers: {
      isToken: false,
    },
    method: "get",
  });
}

// 导出
export function userExport() {
  return request({
    url: `/user/excel`,
    headers: {
      isToken: false,
    },
    method: "post",
    responseType: "blob",
  });
}

// 重置密码
export function resetPwd(data) {
  return request({
    url: `/user/resetPwd`,
    headers: {
      isToken: false,
    },
    method: "post",
    data
  });
}